<?php

namespace App\Http\Controllers\Admin;

use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use App\Models\ContactInfo;

class ContactInfoController extends Controller
{
    public function index(Request $request) {

    	$condition = $request->except('input');
    	//dd($condition);
    	$datas = ContactInfo::search($condition)->latest()->paginate();
    	return view('admin.contact.index', ['datas' => $datas]);
    }

    public function destroy(ContactInfo $contact) {
    	$contact->delete();
    	return response()->json(['success' => 'ok']);
    }
}
